﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Secondhand_Book_Trade
{
    public partial class UserDashboard_aspx : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            // 权限校验：只允许普通用户访问
            if (Session["UserID"] == null || Session["Role"] == null || Session["Role"].ToString() != "0")
            {
                Response.Redirect("Login.aspx");
                return;
            }
            lblUsername.Text = Session["Username"]?.ToString();
            lblNickname.Text = Session["Nickname"]?.ToString();
            lblRole.Text = "普通用户";
            imgAvatar.ImageUrl = string.IsNullOrEmpty(Session["AvatarUrl"]?.ToString()) ? "default.png" : Session["AvatarUrl"].ToString();
            lblEmail.Text = Session["Email"]?.ToString();
            lblPhone.Text = Session["Phone"]?.ToString();
        }
    }
}